//@author A0105543N
#ifndef RECORD_H
#define RECORD_H

#include "Trash.h"
#include "Trace.h"

using namespace std;

class Record{
private:
	Trace* xpensTrace;
	vector <string> ExpCategory;
	vector <string> PayCategory;
	int otherExp;        //number of categories + 1
	int otherPay;
public:
	Record();
	void addExpCat(int,string);
	//pre: take in a position where to add the expense category and the new category name
	//post: add it
	void addPayCat(int,string);
	//similar to addExpCat
	bool newRecord(Item&);
	//pre:take in an empty item
	//post:recort this item
	bool recordCategory(Item&);
	//pre: a transaction is passed with part of it recorded
	//post: display category and record the category according to user's requirement(can update category)
	bool updateRecord(streampos, Item&);
	//pre: take in the position in the file of the original transaction
	//post: record the updated attribute of the transaction
	void setCategory();
	//initialize category if not first time use
	bool createItem(Item&);
	bool updateItem(streamoff, Item&);
	//pre:take in the position in the file where to update and an empty item to indicate whether is expense or payment
	//post:return true for successful update. 
	void deleteExpCat(int);
	void deletePayCat(int);
	bool deleteExp(int&,string&);
	//will also be called by other class
	bool deletePay(int&,string&);
	void display(vector <string>);
	//pre:take in a vector of categories
	//post:print it in a decent form
	Trace* getTrace();
	void saveExit();
	//save category to text file
};

#endif